using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using ThridGroup.ERP.ProductionSystem;

namespace ThridGroup.ERP.EntityFrameworkCore.Configurations
{
    public class MaterialTypeConfiguration : IEntityTypeConfiguration<MaterialType>
    {
        public void Configure(EntityTypeBuilder<MaterialType> builder)
        {
            builder.ToTable("MaterialTypes");

            builder.HasKey(x => x.Id);

            builder.Property(x => x.MaterialTypeName)
                .IsRequired()
                .HasMaxLength(100);

            builder.Property(x => x.ParentId)
                .IsRequired();

            builder.Property(x => x.Index)
                .IsRequired();

            builder.Property(x => x.IsEnable)
                .IsRequired();

            builder.Property(x => x.CreateTime)
                .IsRequired();

            builder.Property(x => x.IsDeleted)
                .IsRequired();
        }
    }
} 